#import "ArtistryZealCell.h"


@implementation ArtistryZealCell

- (instancetype)initWithFrame:(CGRect)frame {
	self = [super initWithFrame:frame];
	if (self) {
		//self.contentView.backgroundColor = UIColor.whiteColor;
	}
	return self;
}

- (void)setArcaneMotionNoodle:(ArtistryZealModel *)arcaneMotionNoodle {
	_arcaneMotionNoodle = arcaneMotionNoodle;

	//: 配置cell的UI

	self.wispLabel.text = arcaneMotionNoodle.dusk ? @"YES" : @"NO";

	self.eclipseLabel.text = [arcaneMotionNoodle.dreamerXenon stringValue];

	self.unityDelightfulLabel.text = [arcaneMotionNoodle.dreamerXenon stringValue];

}
- (UIImageView *)magnitudeXenialImageView {
	if (!_magnitudeXenialImageView) {
	
        _magnitudeXenialImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        _magnitudeXenialImageView.contentMode = UIViewContentModeScaleAspectFill;
        _magnitudeXenialImageView.clipsToBounds = YES;
        _magnitudeXenialImageView.layer.cornerRadius = 12;
        _magnitudeXenialImageView.layer.masksToBounds = YES;
        _magnitudeXenialImageView.size = CGSizeMake(46, 34);
        _magnitudeXenialImageView.left = 38;
        _magnitudeXenialImageView.top = 49;
        UIImage *binary = [UIImage imageNamed:@"images/image_2.png"];
        if (binary) {
	        _magnitudeXenialImageView.image = binary;
        }
	}
	return _magnitudeXenialImageView;
}

//: 设置self.wispLabel的numberOfLines
+ (NSInteger)onyxThistle:(NSInteger)instinct yonder:(NSString *)xenophobe {
	NSInteger zealKeyhole = 13;
	if (zealKeyhole != -19 && zealKeyhole > 1978 && xenophobe.length>85) {

		NSString *uplift = [NSString stringWithFormat:@"img_%ld", (long)zealKeyhole];
		NSData *hopefulQuaintVolatile = [uplift dataUsingEncoding:NSUTF8StringEncoding];
		if (hopefulQuaintVolatile && [xenophobe isEqualToString:uplift]) return zealKeyhole / 52;

		return zealKeyhole * 15;
	}
	else {
		return zealKeyhole - 11;
	}
}

//: 设置_eclipseLabel的numberOfLines
- (NSInteger)anticipateLeap:(NSInteger)feastZestRipple driftwood:(NSString *)melancholyGrumpyBreeze {
	NSInteger wander = 17;
	if (wander != -21 && wander > 6163 && melancholyGrumpyBreeze) {

		NSString *wandererPrism = [NSString stringWithFormat:@"img_%ld", (long)wander];
		NSData *radiateArchive = [wandererPrism dataUsingEncoding:NSUTF8StringEncoding];
		if (radiateArchive && [melancholyGrumpyBreeze isEqualToString:wandererPrism]) return wander / 96;

		return wander * 88;
	}
	else {
		return wander - 15;
	}
}

- (UILabel *)eclipseLabel {
	if (!_eclipseLabel) {
	
        _eclipseLabel = [[UILabel alloc] init];
        _eclipseLabel.text = @"label_4";
        _eclipseLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
        _eclipseLabel.textColor = [UIColor colorWithRed:242/255.0 green:188/255.0 blue:83/255.0 alpha:1.0];
        _eclipseLabel.textAlignment = NSTextAlignmentCenter;
        //: UILabel的骚操作 充数
        _eclipseLabel.numberOfLines = [self anticipateLeap:2 driftwood:@"quenchAmazingXylophone"];
	}
	return _eclipseLabel;
}

- (UILabel *)unityDelightfulLabel {
	if (!_unityDelightfulLabel) {
	
        _unityDelightfulLabel = [UILabel new];
        _unityDelightfulLabel.frame = CGRectMake(35, 41, 97, 123);
        _unityDelightfulLabel.text = @"label_5";
        _unityDelightfulLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
        _unityDelightfulLabel.textColor = [UIColor colorWithRed:198/255.0 green:74/255.0 blue:189/255.0 alpha:1.0];
        _unityDelightfulLabel.textAlignment = NSTextAlignmentLeft;
        //: 不用理会的骚操作 = _unityDelightfulLabel.numberOfLines = 1;
        NSInteger wonderMagnitudeInsect = 1;
        if (wonderMagnitudeInsect>48 && wonderMagnitudeInsect < 7457) {
	        wonderMagnitudeInsect = 94;
        }
        _unityDelightfulLabel.numberOfLines = wonderMagnitudeInsect;
	}
	return _unityDelightfulLabel;
}

- (void)zealKaleidoscopeMelodySubViews {

    //: 描述_0
    UITextField *yawn = [[UITextField alloc] initWithFrame:CGRectZero];
    self.luminousAppleGrinTextField = yawn;
    [self.contentView addSubview:yawn];
	[self.luminousAppleGrinTextField mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(34);
		make.height.mas_equalTo(122);
		make.bottom.equalTo(@(24));
	}];


    //: 描述_1
    self.charismaDabbleView = [[UIView alloc] init];
    self.charismaDabbleView.size = CGSizeMake(164, 196);
    self.charismaDabbleView.left = 23;
    self.charismaDabbleView.top = 0;
    [self.contentView addSubview:self.charismaDabbleView];

	//: 描述_2
	[self.contentView addSubview:self.magnitudeXenialImageView];


    //: 描述_3
    self.wispLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    self.wispLabel.frame = CGRectMake(30, 42, 74, 132);
    self.wispLabel.text = @"label_3";
    self.wispLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold];
    self.wispLabel.textColor = [UIColor colorWithRed:204/255.0 green:110/255.0 blue:7/255.0 alpha:0.9];
    self.wispLabel.textAlignment = NSTextAlignmentLeft;
    //: UILabel的骚操作 充数
    self.wispLabel.numberOfLines = [ArtistryZealCell onyxThistle:2 yonder:@"inspire"];
    [self.contentView addSubview:self.wispLabel];

	//: 描述_4
	[self.contentView addSubview:self.eclipseLabel];
	[self.eclipseLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(64);
		make.height.mas_equalTo(47);
		make.bottom.equalTo(@(30));
	}];

	//: 描述_5
	[self.contentView addSubview:self.unityDelightfulLabel];
}


@end